import assessCheckApi from './api'
import { axios } from '@/utils/request'

// 流程列表-分页查询
export function list(params){
  return axios({
    url: assessCheckApi.list,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}

// 查询当前流程任务详情-通过当前流程任务id
export function queryJobByJobId(params){
  return axios({
    url: assessCheckApi.queryJobByJobId,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}

// 删除办公用品申请流程
export function deleteGwycFlowJob(params){
  return axios({
    url: assessCheckApi.deleteGwycFlowJob,
    method:'delete',
    params:{...params},
    url_2:'outside',
  })
}

// 退回上一环节流程任务
export function returnJob(data){
  return axios({
    url: assessCheckApi.returnUpperFlowJob,
    method:'post',
    data:{...data},
    url_2:'outside',
  })
}

// 通过当前流程id-退回第一步
export function returnStart(params){
  return axios({
    url: assessCheckApi.returnStart,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}

// 办公用品申请管理流程保存
export function saveFlow(data){
  return axios({
    url: assessCheckApi.saveFlow,
    method:'post',
    data:{...data},
    url_2:'outside',
  })
}

// 办公用品申请管理流程提交
export function submitFlow(data){
  return axios({
    url: assessCheckApi.submitFlow,
    method:'post',
    data:{...data},
    url_2:'outside',
  })
}

// 流程监控-分页查询
export function flowJkPage(params){
  return axios({
    url: assessCheckApi.flowJkPage,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}
// 下载个人签名
export function downMyQm(params){
  return axios({
    url: assessCheckApi.downMyQm,
    method:'get' ,
    params:{...params},
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}
// --------------------------------

// 办公用品库存管理-分页列表查询
export function kcList(params){
  return axios({
    url: assessCheckApi.kcList,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}
// 办公用品申请管理流程
export function initBzFlow(data){
  return axios({
    url: assessCheckApi.initBzFlow,
    method:'post',
    data:{...data},
    url_2:'outside',
  })
}
// 通过物品编号拿到物品数量
export function getwpsl(params){
  return axios({
    url: assessCheckApi.getwpsl,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}
// 删除办公用品申请流程
export function deleteLgqsFlowJob(params){
  return axios({
    url: assessCheckApi.deleteLgqsFlowJob,
    method:'delete',
    params:{...params},
    url_2:'outside',
  })
}
//------------------
// 办公用品库存管理-通过id查询
export function queryById(params){
  return axios({
    url: assessCheckApi.queryById,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}

//--------------------
//增加申请明细
export function addsqmx(params){
  return axios({
    url: assessCheckApi.addsqmx,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}
// 删除申请明细
export function delsqmx(params){
  return axios({
    url: assessCheckApi.delsqmx,
    method:'delete',
    params:{...params},
    url_2:'outside',
  })
}
//更新申请明细
export function updatesqmx(params){
  return axios({
    url: assessCheckApi.updatesqmx,
    method:'get',
    params:{...params},
    url_2:'outside',
  })
}
// 获取已办列表-通过当前流程id-自定义退回
export function queryAllYbJob(params){
    return axios({
      url: assessCheckApi.queryAllYbJob,
      method:'get' ,
      params:{...params},
      url_2:'outside',
    })
}
// 自定义-退回环节
export function returnUpperzdyFlowJob(data){
    return axios({
      url: assessCheckApi.returnUpperzdyFlowJob,
      method:'post' ,
      data:data,
      url_2:'outside',
    })
}
